import http from '@/http'

export default {
    /**
     * 进出口列表
     * @param {number} page  页码
     * @param {Function} success 回调
     */
    list(page, success) {
        http.get('transport/list', {
            page: page
        }, success);
    },

    areas(success){
      http.get('area/all', {},success);
    },
    /**
     * 进出口检索
     * @param {number} page 页码
     * @param {string} key 关键词
     * @param {Function} success 回调
     */
    search(page, key, success) {
        http.get('transport/search', {
            page: page,
            key: key
        }, success);
    },
    /**
     * 添加进出口
     * @param {Object} transport 进出口
     * @param {Function} success 回调
     */
    save(transport, success) {
        http.postBody('transport/add', transport, success)
    },
    /**
     * 更新进出口
     * @param {Object} transport 进出口
     * @param {Function} success 回调
     */
    update(transport, success) {
        http.postBody('transport/edit', transport, success)
    },
    /**
     * 删除进出口
     * @param {number} id 进出口id
     * @param {Function} success 回调
     */
    delete(id, success) {
        http.get('transport/delete/' + id, success);
    }
}
